package br.com.lazyprogrammer.app.ffo.model;

/**
 * Created by LimaoGames on 12/10/2014.
 */
public class Quantity {

    public enum Type {
        QUANTITY, // Quantidade
        KG, // Kilogramas
        G, // Gramas
        L, // Litros
        ML; // Mililitros

        public static String get(Type type, int value) {
            switch (type) {
                case QUANTITY:
                    return "x" + value;

                default:
                    return value + type.name();
            }
        }
    }

    private Type type;

    private int value;

    public Quantity(int value, Type type) {
        this.value = value;
        this.type = type;
    }

    public int getValue() {
        return value;
    }

    @Override
    public String toString() {
        return Type.get(type, value);
    }

}
